package qjc.h_二叉树;

import com.二叉树.练习题.TreeNode;

public class h2_二叉树的最大深度 {
    public int maxDepth(TreeNode root) {
        if (root == null) {
            return 0;
        }
        int a = maxDepth(root.left);
        int b = maxDepth(root.right);
        return Integer.max(a, b) + 1;
    }
}
